package com.youdoneed.community.common.vo;

import java.util.List;

/**
 * 分页数据。
 *
 * @author Ewing
 * @since 2017-04-22
 **/
public class PageData<T> {
    private long total;

    private List<T> rows;

    public PageData() {
    }

    public PageData(List<T> rows) {
        if (rows == null) {
            return;
        }
        this.rows = rows;
        this.total = rows.size();
    }

    public PageData(long total, List<T> rows) {
        this.total = total;
        this.rows = rows;
    }

    public long getTotal() {
        return total;
    }

    public PageData<T> setTotal(long total) {
        this.total = total;
        return this;
    }

    public List<T> getRows() {
        return rows;
    }

    public PageData<T> setRows(List<T> rows) {
        this.rows = rows;
        return this;
    }
}
